import java.util.Random;
import java.util.Scanner;

/**
 * ClassName NewKnoledge
 * Description TODO
 * Author Yanyan
 * Date 2025/11/5 21:52
 * Version 1.0
 */
public class NewKnoledge {
    public static void main9(String[] args) {
        Scanner in = new Scanner(System.in);
            while(in.hasNextInt()){
                int n = in.nextInt();

                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < n; j++) {
                        if(i == j || i + j == n - 1){
                            System.out.print("*");
                        } else {
                            System.out.print(" ");
                        }
                    }
                    System.out.println();
                }
            }
    }

    public static void main8(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //表示只要有读取整数就继续，如果要停止按Ctrl + D;
        while(scanner.hasNextInt()) {
            int age = scanner.nextInt();
            System.out.println(age );
        }
    }

    public static void main7(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入你的年龄");
        int age = scanner.nextInt();
        System.out.println("年龄：" + age);

        scanner.nextLine();//输入字符串前先读取一次回车，防止读取回车

        System.out.println("输入名字：");
        String name = scanner.nextLine();//意思是读取回车
        //String name = scanner.next(); //这种表述，读到空格结束
        System.out.println("姓名" + name);

        System.out.println("请输入体重：");
        float weight = scanner.nextFloat();
        System.out.println("体重是：" + weight);

        scanner.close();
    }


    public static void main6(String[] args) {
        System.out.println("输出数据换行");
        System.out.print("输出数据不换行");
        System.out.printf("%s\n","hello");
    }


    public static void main5(String[] args) {
        Random random = new Random();
        int num = random.nextInt(100);

        Scanner scan = new Scanner(System.in);
        while(true) {
            System.out.println("请输入您猜的数字：");
            int i = scan.nextInt();
            if(i > num) {
                System.out.println("猜大了");
            } else if (i == num) {
                System.out.println("猜对了");
                break;
            } else {
                System.out.println("猜小了");
            }
        }
    }

    public static void main4(String[] args) {
        Random random = new Random();
        int num = random.nextInt(100);

        System.out.println(num);

        Scanner scan = new Scanner(System.in);
        int i = scan.nextInt();

        System.out.println(i);
    }

    public static void main3(String[] args) {
        double sum = 0;
        int f = 1;
        for (int i = 1; i < 101; i++) {
            sum += 1.0 / i * f;
            f *= -1;
        }
        System.out.println(sum);
    }

    public static void main2(String[] args) {
        int a = 12;
        int b = 18;
        int c = a % b;
        while(c != 0) {
            a = b;
            b = c;
            c = a % b;
        }
        System.out.println(b);
    }

    public static void main1(String[] args) {
        int count = 0;
        for (int i = 0; i < 101; i++) {
            if(i % 10 == 9) {
                count++;
            } else if (i / 10 == 9) {
                count++;
            }
        }
        System.out.println(count);
    }
}
